import { createApp } from 'vue'
import { createRouter, createWebHashHistory } from "vue-router";
import App from './App.vue'
// 注意：这种方式将会导入所有组件
// import NutUI from "@nutui/nutui";
// 采用按需加载时  此全局css样式，需要删除
import "@nutui/nutui/dist/style.css";
// createApp(App).use(NutUI).mount("#app");

import ObtainNft from './components/ObtainNft.vue'
import ObtainNftSuccess from './components/ObtainNftSuccess.vue'
import BuyNft from './components/BuyNft.vue'

// vue
import { Button } from '@nutui/nutui';
import { Image } from '@nutui/nutui';
import { Cell, CellGroup, Icon } from '@nutui/nutui';

import { Navbar } from '@nutui/nutui';
import { Layout,Row,Col } from '@nutui/nutui';
import { Popup,OverLay } from '@nutui/nutui';
import { Input, TextArea } from '@nutui/nutui';

const routes = [
    { path: '/obtainNftSuccess', component: ObtainNftSuccess },
    { path: '/buyNft', component: BuyNft },
    { path: '/', component: ObtainNft },
]
const router = createRouter({
    mode: 'hash',
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHashHistory(),
    routes, // `routes: routes` 的缩写
})


const app = createApp(App);

//整个应用支持路由。
app.use(router)

app.use(Button);
app.use(TextArea);
app.use(Image);
app.use(Cell);
app.use(CellGroup);
app.use(Icon);
app.use(Input);
app.use(Layout);
app.use(Row);
app.use(Col);

app.use(Navbar);

app.use(Popup)
app.use(OverLay)


app.mount("#app")
